QUAL: realign Stock Transfer notifications/triggers to CREATE/MODIFY (PR #37557)#31
Open
QUAL: realign Stock Transfer notifications/triggers to CREATE/MODIFY (PR #37557)#31
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
STOCKTRANSFER_CREATEetSTOCKTRANSFER_MODIFY.$object->context) pour rester simple et mergeable.htdocs/langs/en_US/*et utiliser les hooks existants uniquement pour compléter la génération des messages/attachements.Description
Notify::$arrayofnotifsupportedpour ne garder queSTOCKTRANSFER_CREATEetSTOCKTRANSFER_MODIFY(htdocs/core/class/notify.class.php).STOCKTRANSFER_CREATEetSTOCKTRANSFER_MODIFY(htdocs/install/mysql/data/llx_c_action_trigger.sqlethtdocs/install/mysql/migration/23.0.0-24.0.0.sql).call_trigger()spécialisés du cycle de vie dans la page card et remplacé par l’injection d’un contexte métier explicite avant l’update()(ex.$object->context['stocktransfer_event'] = 'destock') pour les sous-casdestock,destock_cancel,addstock,addstock_cancel, et gérévalidate/unvalidate/closevia actions de confirmation standards (htdocs/product/stock/stocktransfer/stocktransfer_card.php).StockTransferpour appelerSTOCKTRANSFER_MODIFY(au lieu de triggers spécialisés) et renseigner unstocktransfer_eventpar défaut lorsque nécessaire (validate,unvalidate,close) afin que le même triggerMODIFYporte les sous-événements (htdocs/product/stock/stocktransfer/class/stocktransfer.class.php).Notifypour gérerSTOCKTRANSFER_CREATEetSTOCKTRANSFER_MODIFYet pour sélectionner un libellé métier basé sur$object->context['stocktransfer_event'], tout en conservant un unique template génériqueSTOCKTRANSFER_MODIFY_TEMPLATEpour les envois (htdocs/core/class/notify.class.php).htdocs/langs/en_US/other.langavec des clésNotify_STOCKTRANSFER_MODIFY_*pour les sous-cas métier et suppression des clés spécialisées précédentes horsen_US.stocktransfer_senddans la liste des modèles d’emails et pré-send/doc attachment (aucun contournement via hooks pour recréer des triggers spécialisés) (htdocs/admin/mails_templates.phpreste intact pour l’élémentstocktransfer_send).fix(stocktransfer): realign notifications and triggers on CREATE/MODIFY.Testing
php -lsur les fichiers modifiés (htdocs/core/class/notify.class.php,htdocs/product/stock/stocktransfer/stocktransfer_card.php,htdocs/product/stock/stocktransfer/class/stocktransfer.class.php) et tous les fichiers contrôlés n’ont renvoyéNo syntax errors detected(succès).git commit) confirmant l’état propre du working tree après modifications (opération réussie).Codex Task